# -*- coding: utf-8 -*-
"""
   File Name:  print_save_hyperparameter.py
   Author :    liccoo
   Time:       2022/8/24 12:53
"""
import os


def print_save_hyperparas(args, path):
    save_path = os.path.join(path, 'hyperparameters.txt')  # 超参数保存路径

    print('-' * 100)  # 打印分割线

    for arg in vars(args):
        print(arg, ':', getattr(args, arg))

        with open(save_path, "a+") as f:  # 保存超参数
            f.write(arg)  # 参数名
            f.write(': ')
            f.write(str(getattr(args, arg)))  # 参数值
            f.write('\n')

    print('-' * 100, '\n')  # 打印分割线
